'''
Created on 2024年8月19日

@author: Administrator
'''

import numpy as np
import wave,math

sRate = 44100
nSamples = sRate*5


print(0b0111_1111_1111_1111)



x = np.arange(nSamples)/float(sRate)
# print(x)
vals = np.sin(2.0*math.pi*220.0*x)
# print(vals)
data = np.array(vals*32767,'int16').tobytes()
# print(data)
file = wave.open('sine220.wav', 'wb')
file.setparams((1,2,sRate,nSamples,'NONE','uncompressed'))
file.writeframes(data)
file.close()
                


